A = 100
B = 150
C = float(A) + float(B)
print('数字求和为 %d' % C)

print('------------------------------------------------')

import math

print(math.sin(3))
print(math.hypot(3, 4))
print(math.sqrt(6))
print(math.pow(2, 8))

b1 = True
b2 = False
print(b1, b2)
print(type(b1))
print(type(b2))

print('------------------------------------------------')

# 类型转化
print(bin(60))
print(oct(60))
print(hex(60))

# int（）将整数、浮点数，字符串转换为十进制整数形式
print(int(6.8))
# float（）将整数、浮点数，字符串转换为浮点数类型
print(float(6.8))
# str（）将整数、浮点数，字符串转换为字符串类型
print(str(6.8))

print('------------------------------------------------')

# 算术运算符
a = 1
b = 2
print(a + b)  # a 与 b 相加
print(a - b)  # a 与 b 相减
print(a * b)  # a 与 b 相乘
print(a / b)  # a 与 b 相除
print(a // b)  # a 与 b 整除运算
print(a % b)  # a 返回除法的余数
print(a ** b)  # a 的 b 次方

print('------------------------------------------------')

# 赋值运算符使用所示：
a = 8
a += 2
print(a)
a -= 2
print(a)
a *= 2
print(a)
a /= 2
print(a)

print('------------------------------------------------')

# 比较运算符使用
a = 2
b = 11
print(a == b)
print(a != b)
print(a > b)
print(a < b)
print(a >= b)
print(a <= b)

print('------------------------------------------------')

# 逻辑运算符
print(True and False)
print(True and True)
print(True or False)
print(not False)

print('------------------------------------------------')

str1 = 'hello'
print('h' in str1)
print('a' in str1)
print('c' not in str1)
print('o' not in str1)

print('------------------------------------------------')


